    /***
     * @description axios封装
     * @file api.ts
     * @author andy
     * @date 2024/3/22 16:40
     */
// file:api.s
// 1、导入axios以及拦截器
import service from './request'

// 根据ID删除商户
export const deleteUserById = (userId:any) => {
    return service({
        url: '/user/index/deleteUserById/' + userId,
        method: 'post'
    })
};


// 管理员登录接口
export const login = (data:any) => {
    return service({
        url: '/user/index/login',
        method: 'post',
        data
    })
};

// 获取菜单树
export const getMenuTree = () => {
    return service({
        url: '/user/index/getMenuTree',
        method: 'post',
    })
};


// 分页获取商户列表
export const getUserList = (data:any) => {
    return service({
        url: '/user/index/getUserList',
        method: 'post',
        data
    })
};

// 修改商户信息
export const updateUser = (data:any) => {
    return service({
        url: '/user/index/updateUser',
        method: 'post',
        data
    })
};

// 批量删除商户信息
export const deleteUserAll = (data:any) => {
    return service({
        url: '/user/index/deleteUserAll',
        method: 'post',
        data
    })
};

// 审核商户
export const checkUser = (data:any) => {
    return service({
        url: '/user/index/checkUser',
        method: 'post',
        data
    })
};

// 品牌分页列表
export const getBrandList = (data:any) => {
    return service({
        url: '/shop/index/getBrandList',
        method: 'post',
        data
    })
};

// 添加品牌
export const addBrand = (data:any) => {
    return service({
        url: '/shop/index/addBrand',
        method: 'post',
        data
    })
};

// 修改品牌状态
export const updateBrandStatus = (data:any) => {
    return service({
        url: '/shop/index/updateBrandStatus',
        method: 'post',
        data
    })
};

// 获取商品类型树
export const getTypeTree = () => {
    return service({
        url: '/shop/type',
        method: 'get',
    })
};

// 修改类型状态
export const setTypeStatus = (typeId:any, typeStatus:any) => {
    return service({
        url: '/shop/type/setTypeStatus/' + typeId + '/' + typeStatus,
        method: 'post'
    })
};

// 删除商品类型
export const deleteTypeById = (typeId:any) => {
    return service({
        url: '/shop/type/deleteTypeById/' + typeId,
        method: 'post'
    })
};


// 添加商品类型
export const addType = (data:any) => {
    return service({
        url: '/shop/type',
        method: 'post',
        data
    })
};

// 修改商品类型
export const updateType = (data:any) => {
    return service({
        url: '/shop/type/updateType',
        method: 'post',
        data
    })
};

// 分页获取商品信息
export const getProdList = (data:any) => {
    return service({
        url: '/shop/prod/getProdList',
        method: 'post',
        data
    })
};


// 添加商品
export const addProd = (data:any) => {
    return service({
        url: '/shop/prod/addProd',
        method: 'post',
        data
    })
};

// 获取商品类型树
export const getTypeSelectTree = () => {
    return service({
        url: '/shop/type/getTypeSelectTree',
        method: 'post',
    })
};

// 获取所有品牌的列表
export const getBrandListAll = () => {
    return service({
        url: '/shop/brand/getBrandListAll',
        method: 'post',
    })
};


// 获取所有单位
export const getUnitListAll = () => {
    return service({
        url: '/shop/unit/getUnitListAll',
        method: 'post',
    })
};

// 获取所有标签
export const getTagListAll = () => {
    return service({
        url: '/shop/tag/getTagListAll',
        method: 'post',
    })
};

// 获取所有供应商
export const getApprListAll = () => {
    return service({
        url: '/shop/appr/getApprListAll',
        method: 'post',
    })
};

// 批量删除商品
export const deleteProdAll = (data: any) => {
    return service({
        url: '/shop/prod/deleteProdAll',
        method: 'post',
        data
    })
};

// 添加商品附件
export const addProdAtta = (data: any) => {
    return service({
        url: '/shop/prod/addProdAtta',
        method: 'post',
        data
    })
};


// 分页获取商品详情
export const getProdInfoList = (data: any) => {
    return service({
        url: '/shop/prodInfo/getProdInfoList',
        method: 'post',
        data
    })
};

// 下单接口
export const addOrder = (data: any) => {
    return service({
        url: '/shop/order/addOrder',
        method: 'post',
        data
    })
};

// 分页获取订单列表
export const getOrderList = (data: any) => {
    return service({
        url: '/shop/order/getOrderList',
        method: 'post',
        data
    })
};


// 批量删除订单
export const deleteAll = (data: any) => {
    return service({
        url: '/shop/order/deleteAll',
        method: 'post',
        data
    })
};


// 根据订单ID获取订单记录列表
export const getOrderRecordList = (orderId:any) => {
    return service({
        url: '/shop/orderRecord/getOrderRecordList/' + orderId,
        method: 'post'
    })
};